/* Include these
   #include <stdint.h>
   something with size_t defined like stddef.h or stdlib.h
 */

typedef uint32_t U8a_unit;
typedef uint_fast8_t U8a_len;

U8a_len
u8a_ahead_len(const char *str);

U8a_len
u8a_back_len(const char *str);

U8a_len
u8a_unit_len(U8a_unit unit);

size_t
u8a_units_size_capped(const char *str, int max_units, size_t rest);

size_t
u8a_units_size(const char *str, size_t rest);

size_t
u8a_units(const char *str, size_t rest);

U8a_unit
u8a_get_unit(const char *str, U8a_len *len);

